<template>
  <div>
    <!-- 导航 -->
    <nav class="nav">
      <div class="w">
        <!-- logo -->
        <img class="navLogo" src="@/assets/img/logo.png" alt="" />
        <!-- 导航 -->
        <CommonNav></CommonNav>
        <!-- 搜索 -->
        <div class="search">
          <i class="iconfont icon-search"></i>
          <input type="text" class="searchInput" placeholder="搜一搜" />
        </div>
        <!-- 购物车图标 -->
        <div class="cart" @click="$router.push('/cart')">
          <i class="iconfont icon-cart"></i>
          <em>{{ $store.getters["Cart/cartNum"] }}</em>
        </div>
      </div>
    </nav>
  </div>
</template>

<script>
// 引入导航组价
import CommonNav from "@/components/Home/CommonNav.vue";
export default {
  components: {
    CommonNav,
  },
};
</script>

<style lang="scss" scoped>
.nav {
  background-color: white;
  .w {
    height: 132px;
    display: flex;
    align-items: center;
  }
  .navLogo {
    width: 200px;
  }
  .search {
    width: 170px;
    height: 32px;
    display: flex;
    align-items: center;
    .icon-search {
      font-size: 18px;
    }
    .searchInput {
      width: 140px;
      height: 16.9px;
      border: none;
      outline: none;
      border-bottom: 1px solid #e7e7e7;
      color: rgb(102, 102, 102);
      padding-left: 5px;
      padding-bottom: 2px;
    }
  }
  .cart {
    position: relative;
    .icon-cart {
      font-size: 22px;
      cursor: pointer;
    }
    em {
      font-style: normal;
      position: absolute;
      right: -13px;
      top: 0;
      padding: 1px 6px;
      line-height: 1;
      background: #e26237;
      color: #fff;
      font-size: 12px;
      border-radius: 10px;
      font-family: Arial;
    }
  }
}
</style>
